import Vue from "vue";
import Vuex from "vuex";
import tab from "./tab";
import cart from "./cart";

Vue.use(Vuex);

export default new Vuex.Store({
  state: {
    isCollapse: false, //控制菜单栏收起还是展开
    userName: "张丹",
  },
  getters: {},
  mutations: {
    // 修改isCollapse的状态
    changeIscollapse(state) {
      console.log("点击了折叠按钮");
      state.isCollapse = !state.isCollapse;
    },
  },
  actions: {},
  modules: {
    tab,
    cart,
  },
});
